package com.visionblue.business.ship.page.collection.panel.flow

import android.os.Bundle
import android.view.View
import androidx.core.content.ContextCompat
import androidx.lifecycle.Observer
import com.visionblue.business.ship.R
//import com.visionblue.business.ship.page.collection.WorkStatus
import com.visionblue.business.ship.util.FormatUtils
import com.visionblue.business.ship.util.MLog
import com.visionblue.business.ship.util.StringUtils
import kotlinx.android.synthetic.main.frag_flow_child.*

/**
 * @author: xlh
 * @date: 2020-05-29 4:46 PM
 * @desc:
 */
//class FlowWorkingFragment : BaseFlowChildFragment() {
//
//    override fun initView(savedInstanceState: Bundle?) {
//
////        mViewModel.checkFlowType(
////            oil = this::showOilPipeWorkingView,
////            water = this::showWaterPipeWorkingView
////        )?.invoke()
//    }
//
//    override fun initData() {
//        super.initData()
//
//        mViewModel.oilFlowInfoLiveData.observe(this, Observer {
////            tvDegree.text = StringUtils.getString(
////                R.string.cubic_meter_format,
////                FormatUtils.format2Decimal(it.positiveAccumulationVal)
////            )
//        })
//
//        mViewModel.waterFlowInfoLiveData.observe(this, Observer {
////            tvDegree.text = StringUtils.getString(
////                R.string.cubic_meter_format,
////                FormatUtils.format2Decimal(it.positiveAccumulationVal)
////            )
//        })
//
////        mViewModel.flowNoChangeInWorkEvent.observe(this, Observer {
////            if (!it) {
////                tvNoChangeTips.visibility = View.GONE
////                mViewModel.checkFlowType(
////                    oil = this::showOilPipeWorkingView,
////                    water = this::showWaterPipeWorkingView
////                )?.invoke()
////            } else {
////                tvNoChangeTips.visibility = View.VISIBLE
////                tvStatus.setTextColor(ContextCompat.getColor(tvStatus.context, R.color.yellowD3))
////                mViewModel.checkFlowType(oil = {
////                    tvStatus.text = "未检测到输油管流量变化"
////                    tvStatus.setTextColor(
////                        ContextCompat.getColor(
////                            tvStatus.context,
////                            R.color.yellowD3
////                        )
////                    )
////                }, water = {
////                    tvStatus.text = "未检测到输水管流量变化"
////                })?.invoke()
//
////            }
////        })
//    }
//
//
//    private fun showOilPipeWorkingView() {
////        ivOilPipe.isChecked = true
////        ivWaterPipe.isChecked = false
////        tvStatus.text = "正在计量进油管流量中..."
////        tvStatus.setTextColor(ContextCompat.getColor(context!!, R.color.green00))
//    }
//
//    private fun showWaterPipeWorkingView() {
////        ivOilPipe.isChecked = false
////        ivWaterPipe.isChecked = true
////        tvStatus.text = "正在计量进水管流量中..."
////        tvStatus.setTextColor(ContextCompat.getColor(context!!, R.color.green00))
//    }
//
//
//    companion object {
//        fun newInstance(): FlowWorkingFragment {
//            return FlowWorkingFragment()
//        }
//    }
//}